<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:p="http://primefaces.org/ui"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets">
    <h:head>
        <title>Licores Nuvo</title>
        <link href="css/style.css" type="text/css" rel="stylesheet"/>
    </h:head>
    <h:body>
        <p:layout fullPage="true">  

            <p:layoutUnit id="top" position="north" size="60" resizable="false" closable="false" collapsible="false">  
                <h:outputText value="North unit content." />  
            </p:layoutUnit>
            <p:layoutUnit position="center">  
                <p:imageSwitch effect="fade" >  
                    <ui:repeat value="#{transicionBean.images}"  var="image">  
                        <p:graphicImage style="width: 100%;height: 514px" value="/img/#{image}" />  
                    </ui:repeat>  
                </p:imageSwitch>
                <h:form> 
                    <p:growl  id="estado" sticky="true"  showDetail="true"  />
                    <table id="login" class="ui-panelgrid ui-widget" role="grid">
                        <thead class="ui-panelgrid-header">
                            <tr class="ui-widget-header" role="row">
                                <td colspan="2" role="columnheader">Login</td>
                            </tr>
                        </thead>
                        <tbody>
                            <tr class="ui-widget-content" role="row">
                                <td role="gridcell">
                                    <label for="usuario">Usuario:</label>
                                </td>
                                <td role="gridcell">
                                    <p:inputText id="usuario" value="#{sesionBean.usuario}" label="Usuario" required="true"  requiredMessage="Ingrese Usuario">
                                        <f:validateLength minimum="4"/>
                                    </p:inputText>    
                                </td>
                            </tr>
                            <tr class="ui-widget-content" role="row">
                                <td role="gridcell">
                                    <label for="clave">Clave:</label>
                                </td>
                                <td role="gridcell">
                                    <p:password id="clave" feedback="false" value="#{sesionBean.clave}" required="true" label="Clave" requiredMessage="Ingrese Contraseña"/>  

                                </td>
                            </tr>
                        </tbody>
                        <tfoot class="ui-panelgrid-footer">
                            <tr class="ui-widget-header" role="row">
                                <td colspan="2" role="columnheader" align="center">
                                    <p:commandButton value="Acceder" action="#{sesionBean.autenticar()}" style="margin:0" global="false" update="estado"/>
                                </td>
                            </tr>
                        </tfoot>
                    </table>
                </h:form>
            </p:layoutUnit>  
            <p:layoutUnit id="bottom" position="south" size="50"  resizable="false" closable="false" collapsible="true">  
                <h:form id="form" >  
                    <p:poll  listener="#{sesionBean.inicio()}" />
                </h:form> 
                <center><span style="color: white"> &copy; 2013 Licores Nuvo</span></center>  
            </p:layoutUnit>  
        </p:layout>  

    </h:body>
</html>

